package com.atguigu.h_listfiles;

import java.io.File;

public class Demo {
    public static void main(String[] args) {
        //创建File对象
        File file = new File("C:\\Users\\WH-HKB\\Desktop\\2023试听Java讲义\\abc");

        //调用方法
        File[] files = file.listFiles();

        System.out.println("files = " + files);//数组

        for (File ziFile : files) {
            System.out.println("ziFile.getName() = " + ziFile.getName());
        }
    }
}
